/*    */ package com.zimbra.cs.filter.jsieve;
/*    */ 
/*    */ import com.google.common.base.Strings;
/*    */ import com.zimbra.cs.filter.ZimbraMailAdapter;
/*    */ import com.zimbra.cs.mime.ParsedAddress;
/*    */ import com.zimbra.cs.mime.ParsedMessage;
/*    */ import javax.mail.MessagingException;
/*    */ import javax.mail.internet.MimeMessage;
/*    */ import org.apache.jsieve.Arguments;
/*    */ import org.apache.jsieve.SieveContext;
/*    */ import org.apache.jsieve.exception.SieveException;
/*    */ import org.apache.jsieve.mail.MailAdapter;
/*    */ import org.apache.jsieve.tests.AbstractTest;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class SocialcastTest
/*    */   extends AbstractTest
/*    */ {
/*    */   protected boolean executeBasic(MailAdapter mail, Arguments args, SieveContext ctx)
/*    */     throws SieveException
/*    */   {
/* 47 */     if (!(mail instanceof ZimbraMailAdapter)) {
/* 48 */       return false;
/*    */     }
/* 50 */     ZimbraMailAdapter adapter = (ZimbraMailAdapter)mail;
/*    */     
/* 52 */     ParsedMessage pm = adapter.getParsedMessage();
/* 53 */     ParsedAddress sender = pm.getParsedSender();
/* 54 */     if ((!Strings.isNullOrEmpty(sender.emailPart)) && (sender.emailPart.endsWith("@socialcast.com"))) {
/*    */       try {
/* 56 */         if (pm.getMimeMessage().getHeader("Reply-To", null) != null) {
/* 57 */           return true;
/*    */         }
/*    */       }
/*    */       catch (MessagingException ignore) {}
/*    */     }
/* 62 */     return false;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/filter/jsieve/SocialcastTest.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */